﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using Light.Framework.Model;

namespace Light.Framework.Contract
{
    /// <summary>
    /// 用户接口
    /// </summary>
    public interface IUser
    {
        /// <summary>
        /// 唯一标识
        /// </summary>
        int ID { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        string Name { get; set; }

        /// <summary>
        /// 登录密码
        /// </summary>
        string Password { get; set; }

        /// <summary>
        /// 电话号码
        /// </summary>
        string Phone { get; set; }

        /// <summary>
        /// 是否为超级用户
        /// </summary>
        bool IsSuper { get; set; }

        /// <summary>
        /// 是否为访客
        /// </summary>
        bool IsGuest { get; set; }

        /// <summary>
        /// 角色
        /// </summary>
        IList Roles { get; set; }

        /// <summary>
        /// 所属机构
        /// </summary>
        Organization Organization { get; set; }

        /// <summary>
        /// 是否包含权限
        /// </summary>
        /// <param name="taskCode"></param>
        /// <returns></returns>
        bool HasTask(string taskCode);

        /// <summary>
        /// 是否包含角色
        /// </summary>
        /// <param name="task"></param>
        /// <returns></returns>
        bool HasRole(Role task);

        /// <summary>
        /// 友好名称
        /// </summary>
        string FriendlyName { get; }
    }
}
